package AliDiepPR.ANN.ActivationFunction;

public class SigmoidFunction implements IActivationFunction {

	float alfa = 1f;

	public SigmoidFunction() {
	}

	public SigmoidFunction(float alfa) {
		this.alfa = alfa;
	}

	@Override
	public void Alfa(float alfa) {
		this.alfa = alfa;
	}

	@Override
	public float output(float x) {
		return (float) 1 / ((float) 1 + (float) Math.exp(-alfa * x));
	}

	@Override
	public float output2(float y) {
		return y * (1 - y);
	}

	public String ToString() {
		return "Sigmoid Func";
	}
}
